#ifndef MANAGER_H
#define MANAGER_H
#include <SFML/Graphics.hpp>
#include <vector>
#include <map>
#include "Utils.h"
#include "Entities.h"
#include "Tile.h"
using namespace sf;
using namespace std;

class GameManager
{
private:
    Player* player;
	map<Entity::CType, Image> images;
    vector<Entity *> entitylist;
    vector< vector<Tile> > tiles;
    Image loadImage(string);
public:
	// Null constructor.
    GameManager();
    // Load configuration data from file.
    void LoadCfg(string);
    // Set up map for use.
    void SetupMap();
    // Load content (e.g., images) from files.
    void LoadContent();
    void LoadContent(vector<string>);
    // Update all objects.
    void Update(float);
    // Draw all objects.
    void Draw(RenderTarget&);
    // Add an entity through various methods
    void AddEntity(Entity::EType, Vector2f);
    void AddEntity(Entity*);
    void AddEntities(vector<Entity *>&);
    // Remove an entity.
    void DeleteEntity(Entity*);
    // Retrieve various subvectors of all entities
    vector<Entity *>* Entities();
    vector<Enemy *> Enemies();
    vector<Scenery *> Sceneries();
    // Grab pointer to an image.
	Image* GetImage(const string&) const;
	Image* GetImage(const Entity::EType&) const;
	// Grab pointer to player entity.
    Player* PlayerPtr();
private:
	float friction, cameraspring;
	// Turn tiles into entities for actual use.
    void FinalizeTiles();
};
#endif
